package com.DHH.Service.Order.Impl;
import com.DHH.Entity.Order.OrderInfoState;
import com.DHH.Mapper.Order.OrderInfoStateMapper;
import com.DHH.Service.Order.IOrderInfoStateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderInfoStateServiceImpl implements IOrderInfoStateService{
	
	@Autowired
    private OrderInfoStateMapper orderInfoStateMapper;
    
   @Override
   public OrderInfoState insertOrderInfoState(OrderInfoState orderInfoState){
	   
        orderInfoStateMapper.insertSelective(orderInfoState);
	   return orderInfoState;
	   
   };
   @Override
   public OrderInfoState updateOrderInfoState(OrderInfoState orderInfoState){
	     orderInfoStateMapper.updateByPrimaryKeySelective(orderInfoState);
        return orderInfoState;
   };
   @Override
   public OrderInfoState deleteOrderInfoState(OrderInfoState orderInfoState){

	     orderInfoStateMapper.delete(orderInfoState);
        return orderInfoState;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public OrderInfoState saveOrUpdateOrderInfoState(OrderInfoState orderInfoState){
        if(orderInfoState.getId()==null)
        {
            orderInfoStateMapper.insertSelective(orderInfoState);
        }else{
            orderInfoStateMapper.updateByPrimaryKeySelective(orderInfoState);
        }
        return orderInfoState;
    };
}
